/**
 * $Id: BeforeLoginFilter.java 45 2011-10-06 09:42:07Z feigme@gmail.com $
 */
package com.iary.interfaces.security;

import java.io.IOException;

import javax.servlet.FilterChain;
import javax.servlet.ServletException;
import javax.servlet.ServletRequest;
import javax.servlet.ServletResponse;
import javax.servlet.http.HttpServletRequest;

import org.springframework.web.filter.GenericFilterBean;

public class BeforeLoginFilter extends GenericFilterBean {

	public void doFilter(ServletRequest request, ServletResponse response,
			FilterChain chain) throws IOException, ServletException {
		String type = request.getParameter("type");
		if (type != null) {
			HttpServletRequest req = (HttpServletRequest) request;
			req.getSession().setAttribute("type", type);
		}
		chain.doFilter(request, response);
	}

}
